package com.zhuchaooasystem.presenter.setting;

import android.app.Activity;

import com.zhuchaooasystem.base.BasePresenter;
import com.zhuchaooasystem.widget.ConfirmDialog;

/**
 * Created by zhangyajiang on 2016/12/22.
 */

public class SettingPresenter extends BasePresenter<SettingContract.View> implements SettingContract.Presenter {

    public SettingPresenter(Activity activity, SettingContract.View view) {
        super(activity, view);
    }


    @Override
    public void showDialog() {
        ConfirmDialog dialog = new ConfirmDialog(mActivity);
        dialog.show();
        dialog.setTextTitle("退出提示");
        dialog.setTextContent("确定要退出登录？");
        dialog.setOnViewClickListener(new ConfirmDialog.OnViewClickListener() {
            @Override
            public void onClickOk(ConfirmDialog dialog) {
                mView.logout();
            }

            @Override
            public void onClickCancel(ConfirmDialog dialog) {
                dialog.dismiss();
            }
        });
    }
}
